package com.heima.api;

import com.heima.model.admin.dtos.ChannelDto;
import com.heima.model.admin.dtos.NewsAutoDto;
import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "leadnews-wemedia")
public interface IWemediaClient {
    @PostMapping("/api/v1/sensitive/list")
    ResponseResult list(@RequestBody SensitiveDto dto);


    @PostMapping("/api/v1/sensitive/save")
    ResponseResult save(@RequestBody WmSensitive wmSensitive);



    @DeleteMapping("/api/v1/sensitive/del/{id}")
     ResponseResult deleteById(@PathVariable("id") Integer id);


    @PostMapping("/api/v1/sensitive/update")
    ResponseResult updateById(@RequestBody  WmSensitive wmSensitive);

    @GetMapping("/api/v1/sensitive/getAll")
    List<WmSensitive> listAll();

    /**
     * 分页查询频道
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/channel/list")
    ResponseResult getChannelPage(@RequestBody ChannelDto dto);

    /**
     * 根据id删除频道
     * @param id
     * @return
     */
    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult deleteChannel(@PathVariable Integer id);

    /**
     * 保存频道
     * @param wmChannel
     * @return
     */
    @PostMapping("/api/v1/channel/save")
    ResponseResult channelSave(@RequestBody WmChannel wmChannel);

    /**
     *修改频道
     * @param wmChannel
     * @return
     */
    @PostMapping("/api/v1/channel/update")
    ResponseResult channelUpdate(@RequestBody WmChannel wmChannel);

    /**
     * 面对后台端的管理系统
     * @param newsAutoDto
     * @return
     */
    @PostMapping("/news/getList")
    ResponseResult getListNews(@RequestBody NewsAutoDto newsAutoDto);

    @GetMapping("/news/getDetails/{id}")
    ResponseResult getDetailsNews(@PathVariable Integer id);

    @PostMapping("/news/pass")
    ResponseResult passNews(@RequestBody NewsAutoDto newsAutoDto);


    @PostMapping("/news/fail")
    public ResponseResult failNews(@RequestBody NewsAutoDto newsAutoDto);

    /**
     * 用户认证成功后，创建用户
     * @param user
     */
    @PostMapping("/api/v1/user/create")
    void createUser(@RequestBody ApUser user);
}
